
package ProOF.apl.problems.real.functions;

import ProOF.com.LinkerParameters;

/**
 *
 * @author Hossomi
 */
public class RealFuncGP extends aRealFunction{

	@Override
	public void parameters(LinkerParameters link) throws Exception {

	}
	
	@Override
	public int dimension() {
		return 2;
	}
	
	@Override
	public double min( int i ) {
		return -2;
	}
	
	@Override
	public double max( int i ) {
		return 2;
	}

	@Override
	public double f(double[] x) throws Exception {
		check(x);
        
        return (1 + 
                (x[0] + x[1] + 1) * (x[0] + x[1] + 1) * 
                (19 - 14*x[0] + 3*x[0]*x[0] - 14*x[1] + 6*x[0]*x[1] + 3*x[1]*x[1])) *
                (30 + 
                (2*x[0] - 3*x[1]) * (2*x[0] - 3*x[1]) *
                (18 - 32*x[0] + 12*x[0]*x[0] + 48*x[1] - 36*x[0]*x[1] + 27*x[1]*x[1]));
	}

	@Override
	public String name() {
		return "GP";
	}

	@Override
	public String description() {
		return "Goldstein & Price polynomial function";
	}	
}
